

package com.io.controller;

import com.io.dto.ApiResult;
import com.io.service.SysLogService;
import com.io.utils.PageUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;


/**
 * 系统日志
 *
 * @author guodd
 */
@Api(tags = "系统日志")
@Controller
@RequestMapping("/sys/log")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;

    @ApiOperation("日志列表")
    @ResponseBody
    @PostMapping("/list")
    @RequiresPermissions("sys:log:list")
    public ApiResult list(@RequestParam Map<String, Object> params) {
        PageUtils page = sysLogService.queryPage(params);
        return ApiResult.ok(page.getList()).put("total", page.getTotalCount());
    }

}
